From 8d5959de56eecba0be23d69e40ba7af79ead4459 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 22 Nov 2003 12:30:13 +0000 Subject: [PATCH] Committing Evan's patches (with some modifications), reintroducing class=internal for ordinary links --- includes/DefaultSettings.php | 1 + includes/Skin.php | 114 ++++++++++++-------- includes/SkinCologneBlue.php | 57 ++++++---- includes/SpecialUserlogin.php | 36 ++++++- install-utils.inc | 8 +- languages/Language.php | 10 +- stylesheets/alternate/evan/cologneblue.css | 107 ++++++++++++++++++ stylesheets/alternate/evan/nostalgia.css | 25 +++++ stylesheets/alternate/evan/wikistandard.css | 83 ++++++++++++++ 9 files changed, 370 insertions(+), 71 deletions(-) create mode 100755 stylesheets/alternate/evan/cologneblue.css create mode 100755 stylesheets/alternate/evan/nostalgia.css create mode 100755 stylesheets/alternate/evan/wikistandard.css diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 6636730900..f5ee962f99 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -121,6 +121,7 @@ $wgCookieExpiration = 2592000; # eg, "justthis.domain.org" or ".any.subdomain.net" $wgCookieDomain = ""; $wgCookiePath = "/"; +$wgDisableCookieCheck = false; $wgAllowExternalImages = true; $wgMiserMode = false; # Disable database-intensive features diff --git a/includes/Skin.php b/includes/Skin.php index 238493124d..c1c3e3144c 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -212,7 +212,7 @@ class Skin { } else if ( $broken == "yes" ) { $r = " class='new'"; } else { - $r = ""; + $r = " class='internal'"; } if ( 1 == $wgUser->getOption( "hover" ) ) { @@ -232,7 +232,7 @@ class Skin { } else if ( $broken == "yes" ) { $r = " class='new'"; } else { - $r = ""; + $r = " class='internal'"; } if ( 1 == $wgUser->getOption( "hover" ) ) { @@ -316,7 +316,7 @@ class Skin { $s .= $this->pageTitle(); $s .= $this->pageSubtitle() ; - $s .= getCategories(); // For some odd reason, zhis can't be a function of the object + $s .= getCategories(); // For some odd reason, zhis can't be a function of the object $s .= "\n

"; wfProfileOut( $fname ); return $s; @@ -413,42 +413,42 @@ class Skin { $style = $this->getInternalLinkAttributes( $link, $name ); $s .= " | {$name}"; } -# This will show the "Approve" link if $wgUseApproval=true; -if ( isset ( $wgUseApproval ) && $wgUseApproval ) -{ - $t = $wgTitle->getDBkey(); - $name = "Approve this article" ; - $link = "http://test.wikipedia.org/w/magnus/wiki.phtml?title={$t}&action=submit&doit=1" ; -#wfEscapeHTML( wfImageUrl( $name ) ); - $style = $this->getExternalLinkAttributes( $link, $name ); - $s .= " | {$name}" ; -} } - if ( "history" == $action || isset( $diff ) || isset( $oldid ) ) { - $s .= " | " . $this->makeKnownLink( $wgTitle->getPrefixedText(), - wfMsg( "currentrev" ) ); - } - - if ( $wgUser->getNewtalk() ) { + # This will show the "Approve" link if $wgUseApproval=true; + if ( isset ( $wgUseApproval ) && $wgUseApproval ) + { + $t = $wgTitle->getDBkey(); + $name = "Approve this article" ; + $link = "http://test.wikipedia.org/w/magnus/wiki.phtml?title={$t}&action=submit&doit=1" ; + #wfEscapeHTML( wfImageUrl( $name ) ); + $style = $this->getExternalLinkAttributes( $link, $name ); + $s .= " | {$name}" ; + } } + if ( "history" == $action || isset( $diff ) || isset( $oldid ) ) { + $s .= " | " . $this->makeKnownLink( $wgTitle->getPrefixedText(), + wfMsg( "currentrev" ) ); + } + + if ( $wgUser->getNewtalk() ) { # do not show "You have new messages" text when we are viewing our # own talk page - - if(!(strcmp($wgTitle->getText(),$wgUser->getName()) == 0 && - $wgTitle->getNamespace()==Namespace::getTalk(Namespace::getUser()))) { - $n =$wgUser->getName(); - $tl = $this->makeKnownLink( $wgLang->getNsText( - Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}", - wfMsg("newmessageslink") ); - $s.=" | ". wfMsg( "newmessages", $tl ) . ""; + + if(!(strcmp($wgTitle->getText(),$wgUser->getName()) == 0 && + $wgTitle->getNamespace()==Namespace::getTalk(Namespace::getUser()))) { + $n =$wgUser->getName(); + $tl = $this->makeKnownLink( $wgLang->getNsText( + Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}", + wfMsg("newmessageslink") ); + $s.=" | ". wfMsg( "newmessages", $tl ) . ""; + } } - } - if( $wgUser->isSysop() && - (($wgTitle->getArticleId() == 0) || ($action == "history")) && - ($n = $wgTitle->isDeleted() ) ) { + if( $wgUser->isSysop() && + (($wgTitle->getArticleId() == 0) || ($action == "history")) && + ($n = $wgTitle->isDeleted() ) ) { $s .= " | " . wfMsg( "thisisdeleted", - $this->makeKnownLink( - $wgLang->SpecialPage( "Undelete/" . $wgTitle->getPrefixedDBkey() ), - wfMsg( "restorelink", $n ) ) ); - } + $this->makeKnownLink( + $wgLang->SpecialPage( "Undelete/" . $wgTitle->getPrefixedDBkey() ), + wfMsg( "restorelink", $n ) ) ); + } return $s; } @@ -765,17 +765,22 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval ) unwatched. Therefore we do not show the "Watch this page" link in edit mode */ if ( 0 != $wgUser->getID() && $articleExists) { - if($action!="edit" && $action!="history" && - $action != "submit" ) - {$s .= $sep . $this->watchThisPage(); } - if ( $wgTitle->userCanEdit() ) $s .= $sep . $this->moveThisPage(); + if($action!="edit" && $action!="history" && + $action != "submit" ) + { + $s .= $sep . $this->watchThisPage(); + } + if ( $wgTitle->userCanEdit() ) + $s .= $sep . $this->moveThisPage(); } if ( $wgUser->isSysop() and $articleExists ) { $s .= $sep . $this->deleteThisPage() . $sep . $this->protectThisPage(); } $s .= $sep . $this->talkLink(); - if ($articleExists && $action !="history") { $s .= $sep . $this->historyLink();} + if ($articleExists && $action !="history") { + $s .= $sep . $this->historyLink(); + } $s.=$sep . $this->whatLinksHere(); if($wgOut->isArticle()) { @@ -919,7 +924,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval ) $s = $this->makeKnownLink( $n, $t, "action=delete" ); } else { - $s = wfMsg( "error" ); + $s = ""; } return $s; } @@ -940,7 +945,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval ) } $s = $this->makeKnownLink( $n, $t, $q ); } else { - $s = wfMsg( "error" ); + $s = ""; } return $s; } @@ -1151,6 +1156,29 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval ) return $s; } + function commentLink() + { + global $wgLang, $wgTitle, $wgLinkCache; + + $tns = $wgTitle->getNamespace(); + if ( -1 == $tns ) { return ""; } + + $lns = ( Namespace::isTalk( $tns ) ) ? $tns : Namespace::getTalk( $tns ); + + # assert Namespace::isTalk( $lns ) + + $n = $wgLang->getNsText( $lns ); + $pn = $wgTitle->getText(); + + $link = "{$n}:{$pn}"; + + $wgLinkCache->suspend(); + $s = $this->makeKnownLink($link, wfMsg("postcomment"), "action=edit§ion=new"); + $wgLinkCache->resume(); + + return $s; + } + # After all the page content is transformed into HTML, it makes # a final pass through here for things like table backgrounds. # @@ -1487,7 +1515,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval ) $link = $this->makeKnownLink( $artname, $dt, $q ); if ( 0 == $u ) { - $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ), + $ul = $this->makeKnownLink( $wgLang->specialPage( "Contributions" ), $ut, "target=" . $ut ); } else { $ul = $this->makeLink( $wgLang->getNsText( diff --git a/includes/SkinCologneBlue.php b/includes/SkinCologneBlue.php index 7978e59b18..ca28510538 100644 --- a/includes/SkinCologneBlue.php +++ b/includes/SkinCologneBlue.php @@ -138,6 +138,8 @@ class SkinCologneBlue extends Skin { { global $wgOut, $wgTitle, $wgUser, $wgLang; + $tns=$wgTitle->getNamespace(); + $s = "\n

"; $sep = "
"; @@ -147,45 +149,47 @@ class SkinCologneBlue extends Skin { $s .= $this->menuHead( "qbbrowse" ) . $this->mainPageLink() . $sep . $this->specialLink( "recentchanges" ) - . $sep . $this->specialLink( "randompage" ) - . $sep . $this->specialLink( "newpages" ) - . $sep . $this->specialLink( "imagelist" ) - . $sep . $this->specialLink( "statistics" ) - . $sep . $this->specialLink( "specialpages" ) - . $sep . $this->bugReportsLink() ; - if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ; - $s .= "\n"; + . $sep . $this->specialLink( "randompage" ); + if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ; + $s .= "\n"; if ( $wgOut->isArticle() ) { $s .= $this->menuHead( "qbedit" ); - $s .= "" . $this->editThisPage() . "" - . $sep . $this->makeKnownLink( wfMsg( "edithelppage" ), - wfMsg( "edithelp" ) ); + $s .= "" . $this->editThisPage() . ""; + + $s .= $sep . $this->makeKnownLink( wfMsg( "edithelppage" ), wfMsg( "edithelp" ) ); if ( 0 != $wgUser->getID() ) { - $s .= $sep . $this->specialLink( "upload" ) - . $sep . $this->moveThisPage(); + $s .= $sep . $this->moveThisPage(); } if ( $wgUser->isSysop() ) { - $s .= $sep . $this->deleteThisPage() . - $sep . $this->protectThisPage(); + $dtp = $this->deleteThisPage(); + if ( "" != $dtp ) { + $s .= $sep . $dtp; + } + $ptp = $this->protectThisPage(); + if ( "" != $ptp ) { + $s .= $sep . $ptp; + } } $s .= $sep; $s .= $this->menuHead( "qbpageoptions" ); $s .= $this->talkLink() + . $sep . $this->commentLink() . $sep . $this->printableLink(); if ( 0 != $wgUser->getID() ) { $s .= $sep . $this->watchThisPage(); } + $s .= $sep; - $s .= $this->menuHead( "qbpageinfo" ) + $s .= $this->menuHead("qbpageinfo") . $this->historyLink() . $sep . $this->whatLinksHere() . $sep . $this->watchPageLinksLink(); - if ( Namespace::getUser() == $wgTitle->getNamespace() ) { + if ( Namespace::getUser() == $tns ) { $s .= $sep . $this->userContribsLink(); if ( 0 != $wgUser->getID() ) { $s .= $sep . $this->emailUserLink(); @@ -193,6 +197,7 @@ class SkinCologneBlue extends Skin { } $s .= $sep; } + $s .= $this->menuHead( "qbmyoptions" ); if ( 0 != $wgUser->getID() ) { $name = $wgUser->getName(); @@ -210,6 +215,18 @@ class SkinCologneBlue extends Skin { } else { $s .= $this->specialLink( "userlogin" ); } + + $s .= $this->menuHead( "qbspecialpages" ) + . $this->specialLink( "newpages" ) + . $sep . $this->specialLink( "imagelist" ) + . $sep . $this->specialLink( "statistics" ) + . $sep . $this->bugReportsLink(); + if ( 0 != $wgUser->getID() ) { + $s .= $sep . $this->specialLink( "upload" ); + } + + $s .= $sep . $this->makeKnownLink( wfMsg("specialpages" ), wfMsg("moredotdotdot") ); + $s .= $sep . "\n
\n"; return $s; } @@ -227,9 +244,9 @@ class SkinCologneBlue extends Skin { wfLocalUrlE( "" ) . "\">"; if ( "" != $label ) { $s .= "{$label}: "; } - $s .= "" - . ""; + $s .= "" + . "
"; return $s; } diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 062e7d09af..f84f640224 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -77,6 +77,10 @@ function wfSpecialUserlogin() global $wgUser, $wgOut, $wpPassword, $wpRetype, $wpName, $wpRemember; global $wpEmail, $wgDeferredUpdateList; + if (!cookieCheck()) { + return; + } + if (!$wgUser->isAllowedToCreateAccount()) { userNotPrivilegedMessage(); return; @@ -122,6 +126,10 @@ function wfSpecialUserlogin() global $wgUser, $wpName, $wpPassword, $wpRemember; global $returnto; + if (!cookieCheck()) { + return; + } + if ( "" == $wpName ) { mainLoginForm( wfMsg( "noname" ) ); return; @@ -160,7 +168,7 @@ function wfSpecialUserlogin() { global $wgUser, $wpName, $wgDeferredUpdateList, $wgOutputEncoding; global $wgCookiePath, $wgCookieDomain, $wgDBname; - + if ( "" == $wpName ) { mainLoginForm( wfMsg( "noname" ) ); return; @@ -355,6 +363,32 @@ $cambutton +} + +/* private */ function cookieCheck() { + + global $HTTP_COOKIE_VARS, $wgOut, $returnto; + global $wgDisableCookieCheck; + + if ( $wgDisableCookieCheck ) { + return true; + } + + # XXX: kind of crude check to see if cookies are enabled, but it works OK + + if ( "" == $HTTP_COOKIE_VARS[session_name()]) + { + # Don't go back to login page; they won't get time to + # enable cookies and send us one, so they'll get this msg again. Instead, + # let them enable cookies on the error page, then go back to login page. + # XXX: wipes returnto, unfortunately. + + $returnto = "Special:Userlogin"; + $wgOut->errorpage( "nocookies", "nocookiestext" ); + return false; + } + + return true; } ?> diff --git a/install-utils.inc b/install-utils.inc index 48c5ccb176..f9842476a1 100644 --- a/install-utils.inc +++ b/install-utils.inc @@ -44,10 +44,10 @@ function copyfile( $sdir, $name, $ddir, $perms = 0664 ) { function copydirectory( $source, $dest ) { $handle = opendir( $source ); while ( false !== ( $f = readdir( $handle ) ) ) { - if ( "." == $f{0} ) continue; - # Something made all my "CVSs" go lowercase :( - if ( !strcasecmp( "CVS", $f ) ) continue; - copyfile( $source, $f, $dest ); + $fullname = "$source/$f"; + if ( $f{0} !="." && is_file( $fullname ) ) { + copyfile( $source, $f, $dest ); + } } } diff --git a/languages/Language.php b/languages/Language.php index 54d8d3a0f7..822e42b167 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -374,9 +374,11 @@ this (alternative: like this?).", "qbfind" => "Find", "qbbrowse" => "Browse", "qbedit" => "Edit", -"qbpageoptions" => "Page options", -"qbpageinfo" => "Page info", -"qbmyoptions" => "My options", +"qbpageoptions" => "This page", +"qbpageinfo" => "Context", +"qbmyoptions" => "My pages", +"qbspecialpages" => "Special pages", +"moredotdotdot" => "More...", "mypage" => "My page", "mytalk" => "My talk", "currentevents" => "Current events", @@ -546,6 +548,8 @@ contact you through the website without you having to reveal your email address to them, and it also helps you if you forget your password.", "loginerror" => "Login error", +"nocookies" => "Cookies disabled", +"nocookiestext" => "Wikipedia uses cookies to log in users. You have cookies disabled. Please enable them and try again.", "noname" => "You have not specified a valid user name.", "loginsuccesstitle" => "Login successful", "loginsuccess" => "You are now logged in to Wikipedia as \"$1\".", diff --git a/stylesheets/alternate/evan/cologneblue.css b/stylesheets/alternate/evan/cologneblue.css new file mode 100755 index 0000000000..fe6ca0f98f --- /dev/null +++ b/stylesheets/alternate/evan/cologneblue.css @@ -0,0 +1,107 @@ + +body { margin: 0px; padding: 0px; } +#specialform { display: inline; } +#content { top: 0; margin: 0; padding: 0; } +#topbar { padding: 0px; } +#powersearch { + background: #DDEEFF; border-style: solid; border-width: 1; padding: 2; +} +#quickbar { + width: 140px; top: 18ex; padding: 2px; visibility: visible; z-index: 99; +} +#article, #article td, #article th, #article p { + font-family: Verdana, Arial, sans-serif; + font-size: 10pt; color: black; +} +#article p { + padding-top: 0; padding-bottom: 0; + margin-top: 1ex; margin-bottom: 0; +} +p, pre, td, th, li, dd, dt { line-height: 12pt; } + +#footer { padding: 4px; } +#footer form { display: inline; } + +#sitetitle { + font-family: Times, serif; + color: white; + font-weight: normal; font-size: 32pt; + line-height: 32pt; +} +td.top { + background-color: #6688AA; color: white; + margin-top: 4px; margin-bottom: 4px; + padding-top: 0; padding-bottom: 0; + text-transform: uppercase; + font-family: Verdana, Arial, sans-serif; font-size: 8pt; +} +td.top a { + font-family: Verdana, Arial, sans-serif; + background-color: #6688AA; color: white; + text-decoration: none; font-size: 10pt; +} +td.bottom { + font-family: Verdana, Arial, sans-serif; + font-size: 10pt; + padding: 0; +} +#pagestats { + font-family: Verdana, Arial, sans-serif; + color: black; + font-size: 9pt; +} +#sitesub { + font-family: Verdana, Arial, sans-serif; + font-size: 9pt; font-weight: bold; + color: black; + padding-top: 0; +} +#quickbar { + font-family: Verdana, Arial, sans-serif; + font-size: 8pt; font-weight: bold; line-height: 9.5pt; + text-decoration: none; + color: black; + padding: 0; margin-top: 0; +} +#quickbar a { color: #446688; } + +#quickbar h6 { + font-family: Verdana, Arial, sans-serif; + font-size: 10pt; font-weight: bold; line-height: 12pt; + text-decoration: none; + color: #666666; + padding: 0; margin-bottom: 2px; margin-top: 6px; +} +#quickbar form { padding: 0; margin-top: 0; } + +h1 { font-family: Arial, Helvetica, sans-serif; + color: #666666; + font-family: Verdana, Arial, sans-serif; + font-size: 18pt; font-weight: bold; line-height: 21pt; +} +h1.pagetitle { padding-bottom: 0; margin-bottom: 0; } +#article p.subtitle { + color: #666666; font-size: 11pt; font-weight: bold; + padding-top: 0; margin-top: 0; padding-bottom: 1ex; +} + +/* BAD: intended to format links, but formats headings on TOC pages as well +a { color: #0000FF; } +*/ + +a:visited { color: #000080; } +a.interwiki { color: #00C000; } +a.interwiki:visited { color: #008000; } +a.external { color: #00C000; } +a.external:visited { color: #008000; } +a.new { color: #FF0000; } +a.new:visited { color: #800000; } +a.stub { color:#800080 } +a.stub:visited { color:#600060 } + +a.printable { text-decoration: underline; } + +h2, h3, h4, h5, h6 { margin-bottom: 0; } +small { font-size: 75%; } +#toc { border:1px solid #8888aa; background-color:#f7f8ff;padding:5px;font-size:95%; } + diff --git a/stylesheets/alternate/evan/nostalgia.css b/stylesheets/alternate/evan/nostalgia.css new file mode 100755 index 0000000000..8c0ac8533b --- /dev/null +++ b/stylesheets/alternate/evan/nostalgia.css @@ -0,0 +1,25 @@ +#article { } +#specialform { display: inline; } +#powersearch { + background: #DDEEFF; border-style: solid; border-width: 1; padding: 2; +} +.bodytext { } +/* BAD: intended to format links, but formats headings on TOC pages as well +a { color: #0000FF; } +*/ +a:visited { color: #000080; } +a.interwiki { color: #00C000; } +a.interwiki:visited { color: #008000; } +a.external { color: #00C000; } +a.external:visited { color: #008000; } +a.new { color: #FF0000; } +a.new:visited { color: #800000; } + +a.stub { color:#800080 } +a.stub:visited { color:#600060 } + +h1.pagetitle { padding-top: 0; margin-top: 0; padding-bottom: 0; margin-bottom: 0; } +h2, h3, h4, h5, h6 { margin-bottom: 0; } +p.subtitle { padding-top: 0; margin-top: 0; } +#toc { border:1px solid #8888aa; background-color:#f7f8ff;padding:5px;font-size:95%; } + diff --git a/stylesheets/alternate/evan/wikistandard.css b/stylesheets/alternate/evan/wikistandard.css new file mode 100755 index 0000000000..48630cb76d --- /dev/null +++ b/stylesheets/alternate/evan/wikistandard.css @@ -0,0 +1,83 @@ +#article { padding: 4px; } +#content { margin: 0; padding: 0; } +#footer { padding: 4px;font-size:95%; } +#pagestats { font-size: 9pt; } +#powersearch { + background: #DDEEFF; border-style: solid; border-width: 1px; padding: 2px; +} +#quickbar { width: 140px; padding: 4px; visibility: visible; z-index:99;font-size:95%;} +#topbar { padding: 4px;font-size:95%; } +#toc { border:1px solid #8888aa; background-color:#f7f8ff;padding:5px;font-size:95%; } +.bodytext { } + +/* BAD: intended to format links, but formats headings on TOC pages as well +a { color: #0000FF; } +*/ + +a:visited { color: #000080; } +a.interwiki { color: #00C000; } +a.interwiki:visited { color: #008000; } +a.external { color: #00C000; } +a.external:visited { color: #008000; } +a.new { color: #FF0000; } +a.new:visited { color: #800000; } +a.stub { color:#800080 } +a.stub:visited { color:#600060 } + +body { margin: 0px; padding: 4px; } +form.inline { display: inline; } + +/* CHECK MERGE @@@ + * h1.pagetitle { padding-top: 0; margin-top: 0; padding-bottom: 0; margin-bottom: 0; + * font-size:130%; } + * h2 { font-size: 112.5%; } + */ + +h1.pagetitle { padding-top: 0; margin-top: 0; padding-bottom: 0; margin-bottom: 0; +font-size:150%; } +h2 { font-size: 120%; } +h2, h3, h4, h5, h6 { margin-bottom: 0;} +h3 { font-size: 106.25%; } +h4 { font-size: 103.125%; } +h5 { font-size: 100%; } +h6 { font-size: 95%; } +hr.sep { color:gray;height:1px;background-color:gray;} +p.subpages { font-size:small;} +p.subtitle { padding-top: 0; margin-top: 0;} +td { empty-cells:show; } +td.bottom { border-top: 1px solid gray; } +td.top { border-bottom: 1px solid gray; } +/* images */ +div.floatright { float:right;margin:0 0 1em 1em; } +div.floatright p { font-style: italic; } + +/* table standards */ +table.rimage { + float:right; + width:1pt; + margin-left:1em; + margin-bottom:1em; + text-align:center; + font-size:smaller; + } + +table.country { + border-width:1; + border-style:solid; + padding:2; + border-spacing:0; + float:right; + width:300px; + } + +table.flag { + background-color:#efefef; + border-width:0; + border-spacing:0; + padding:2; + } + +td.flag { + text-align:center; + width:140px; + } -- 2.20.1